package com.fertshop.gui.listener;

import java.awt.Container;

import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;

import com.fertshop.gui.Main;

public class UpdateShopMenuListener implements MenuListener{

	private JDesktopPane desktop=null;
	
	public UpdateShopMenuListener(JDesktopPane desktop){
		this.desktop=desktop;
	}
	
	@Override
	public void menuCanceled(MenuEvent event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void menuDeselected(MenuEvent event) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void menuSelected(MenuEvent event) {
		JDialog dialog=new JDialog(Main.frame,"Input",true);
		Container ctr=dialog.getContentPane();
		ctr.setLayout(null);
		
		JLabel spDoorNoLabel=new JLabel("Enter Sale Point Door Number :");
		spDoorNoLabel.setBounds(50, 50, 200, 30);
		ctr.add(spDoorNoLabel);
		
		JTextField spDoorNoTf=new JTextField();
		spDoorNoTf.setBounds(260, 50, 100, 30);
		ctr.add(spDoorNoTf);
		
		JLabel spVillageLabel=new JLabel("Enter Sale Point Area :");
		spVillageLabel.setBounds(50, 85, 200, 30);
		ctr.add(spVillageLabel);
		
		JTextField spVillageTf=new JTextField();
		spVillageTf.setBounds(260, 85, 100, 30);
		ctr.add(spVillageTf);
		
		JButton spDoorNoBtn=new JButton("Search");
		spDoorNoBtn.addActionListener(new SearchSubmitActionListener(spDoorNoTf,spVillageTf,
				                       dialog,desktop));
		spDoorNoBtn.setBounds(220, 120, 100, 30);
		ctr.add(spDoorNoBtn);
		
		dialog.setBounds(200,200, 500, 200);
		dialog.setVisible(true);
		
	}

}
